Using SFTP Functions

From version 7.3, you can manage files on SFTP servers. To use the SFTP functions, you must create an instance of the SFTP business entity, and use its properties to define the hostname, port, and credentials of the SFTP server. The SFTP functions will reference this instance.

For details on each of the functions, see Secured FTP (SFTP) Library Object.

To test the SFTP functions:

  1. Download the sample project here.

  2. Open the project in the Real-Time Designer.

  3. Select the Business Entities tab, and then, in the Instances tab, expand the SFTP instance.

  4. Set the initial values for each of the SFTP instance properties:

    • Host: The hostname of the SFTP server.

    • Password: The password for connecting to the SFTP server.

    • Port: The port for connecting to the SFTP server.

    • Username: The username for connecting to the SFTP server.

  5. Select the Presentation tab, and then, in the Callout tab, select the Demo Callout callout, which you can use to test some of the functions.

    The callout shows errors, as you need to define the function parameters that are correct for your SFTP server.

  6. In the callout, right-click Fetch Files List, then, from the menu, select Replace > Action Link.

    The Action Link window appears. This Action Link fetches a list of files with a specified extension from a specified folder, and assigns them to the Fetched Files List business entity.

  7. Define the required parameter values as follows:

    • File Extension: The extension of the file type to list. If the File Extension is empty, all the files in the folder will be listed.

    • Folder Path: The path to the SFTP folder from which to retrieve the file list. If the Folder Path is empty, all the files in the SFTP server's root directory will be listed. You can either enter the path here, or define it as the value of the Folder property so that you can easily reuse it in different functions.

    • Include Subfolders: If all files in the specified folder and its subfolders should be listed (True), or if only files from the specified folder should be listed (False).

  8. Click OK to save your changes.

  9. Update the parameter values in the remaining functions. For details of the required parameter values, see Secured FTP (SFTP) Library Object.

  10. Save and run the project.

  11. Click Quick to open the callout.

  12. Open the Monitor.

  13. In Business Entities, in the Properties tab you can view the status of the commands.

  14. Test the functions.